<?php
//验证是否在登录状态
$id=$_COOKIE["token"];
session_start();
if(isset($_SESSION[$id])){
    $uid=$_SESSION[$id];
    $token=md5(rand(1000,9999));
    setcookie('token',$token,time()+60);
    $_SESSION[$token]=$uid;
}else{
    header("location:?c=Index&a=index");
};
?>